package com.medical.app.controller;

import com.medical.app.common.dto.DoctorDto;
import com.medical.app.entity.OutpatientsTemplate;
import com.medical.app.service.DoctorService;
import com.qf.medical.response.ResponseEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/*
 * @Date : 2024/4/30 下午2:22
 * @Created by Lang
 * @ProjectName : medical-appointment-registration
 */
@RestController
@RequestMapping("/doctor")
@Api(tags = "医生模块信息")
public class DoctorController {
    @Resource
    private DoctorService doctorService;

    @GetMapping("/list")
    @ApiOperation(value = "根据科室id查询所有医生挂号信息")
    public ResponseEntity<List<DoctorDto>> listByDepartmentId(@RequestParam("departmentId") Long departmentId) {
        List<DoctorDto> list = doctorService.listByDepartmentId(departmentId);
        return ResponseEntity.success(list);
    }

    @GetMapping("/list/residue")
    @ApiOperation(value = "根据医生id查询的剩余挂号信息")
    public ResponseEntity<OutpatientsTemplate> listResidue(Long doctorId){
        return ResponseEntity.success(doctorService.listResidue(doctorId));
    }
}
